package fschmidt.db;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Connection;
import java.sql.Statement;
import java.util.Collection;
import java.util.Iterator;
import fschmidt.db.DbKey;
import fschmidt.db.DbKeySetter;
import fschmidt.db.DbObject;
import fschmidt.db.NoKey;
import fschmidt.db.DbArcana;
import fschmidt.db.DbRecord;


public enum NoKeySetter implements DbKeySetter<NoKey> {

	INSTANCE;

	public PreparedStatement prepareStatement(Connection con,NoKey key,String sql,int keyIndex)
		throws SQLException
	{
		PreparedStatement stmt = con.prepareStatement(
			sql
		);
		return stmt;
	}

	public PreparedStatement prepareStatement(Connection con,Collection<NoKey> keys,String sql,DbArcana dbArcana)
		throws SQLException
	{
		return prepareStatement(con,NoKey.INSTANCE,sql,0);
	}

	public NoKey refreshKeyAfterInsert(Connection con,DbRecord<NoKey,? extends DbObject> record) throws SQLException {
		return NoKey.INSTANCE;
	}

	public NoKey getKey(ResultSet rs)
		throws SQLException
	{
		return NoKey.INSTANCE;
	}

	public NoKey getKey(ResultSet rs,String tableName)
		throws SQLException
	{
		return NoKey.INSTANCE;
	}
}
